package com.mrbird.demo.controller;

import com.fasterxml.jackson.annotation.JsonView;
import com.mrbird.demo.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author jbx
 * @package_name com.mrbird.demo.controller
 * @create_date 2021/2/24 10:45
 */
@RestController
public class TestUserController {
    @JsonView(User.AllUserFieldView.class)
    @RequestMapping("/getuser")
    @ResponseBody
    public User getUser() {
        User user = new User();
        user.setUserName("mrbird");
        user.setAge(26);
        user.setPassword("123456");
        user.setBirthday(new Date());
        return user;
    }
}
